<?php

/* Theme.php
 *
 * (C) 2012, StaySimple CMS team.
 *
 * This file is part of StaySimple.
 * http://code.google.com/p/stay-simple-cms/
 *
 * StaySimple is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * StaySimple is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with StaySimple.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Stores theme information.
 */
class Theme {

    private $folder;
    private $type;
    private $name;
    private $author;
    private $url;
    private $urlTitle;
    private $version;
    private $description;
    private $screenshot;
    private $minVersion;
    private $templates;

    public function __construct($folder, $type, $name, $author, $url, $urlTitle, $version, $description, $screenshot, $minVersion, $templates = array()) {
        $this->folder = $folder;
        $this->type = $type;
        $this->name = $name;
        $this->author = $author;
        $this->url = $url;
        $this->urlTitle = $urlTitle;
        $this->version = $version;
        $this->description = $description;
        $this->screenshot = $screenshot;
        $this->minVersion = $minVersion;
        $this->templates = $templates;
    }

    /**
     * Returns the name of the theme's folder. The name of the folder is only 
     * used by StaySimple CMS and is never shown to the user.
     * 
     * @return string The name of this theme's folder 
     */
    public function getFolder() {
        return $this->folder;
    }

    /**
     * Gets the theme type. Can be one of "site" or "administration".
     * 
     * @return strin The theme's type.
     */
    public function getType() {
        return $this->type;
    }

    /**
     * The name that is shown to the user. It's the friendly display name since 
     * it's only used in the UI.
     * 
     * @return string The name of the theme.
     */
    public function getName() {
        return $this->name;
    }

    /**
     * The theme's author.
     * 
     * @return string The name of the theme's author, if any.
     */
    public function getAuthor() {
        return $this->author;
    }

    /**
     * The URL used by the author to show license agreements or the theme's home 
     * page.
     * 
     * @return string The URL present in the theme's XML file.
     */
    public function getUrl() {
        return $this->url;
    }

    /**
     * The title of the URL used by the theme's author.
     * 
     * @return string A friendly title for the URL.
     */
    public function getUrlTitle() {
        return $this->urlTitle;
    }

    /**
     * The current theme's version.
     * 
     * @return string The version, if any, specified in the theme's XML file.
     */
    public function getVersion() {
        return $this->version;
    }

    /**
     * The description for this theme.
     * 
     * @return string The theme's description.
     */
    public function getDescription() {
        return $this->description;
    }

    /**
     * The name of the screenshot file.
     * 
     * @return string The name of the file.
     */
    public function getScreenshot() {
        return $this->screenshot;
    }

    /**
     * The minimun StaySimple CMS version that this theme supports.
     * 
     * @return string The minimum version.
     */
    public function getMinVersion() {
        return $this->minVersion;
    }

    /**
     * The list of existing templates.
     * 
     * @return array An array of PageTemplate objects.
     * @see PageTemplate
     */
    public function getTemplates() {
        return $this->templates;
    }

}
